#!/bin/sh

ws=`pwd`
repo=examination-web
if [ ! -d $repo ]; then
    #git clone https://git.oschina.net/wugf/$repo.git
    git clone https://gitee.com/jiangyuan-beijing/$repo.git
fi

# package
cd $repo
rm -rf dist
git pull
npm install
npm run build

cd $ws
# copy files
rm -rf dist
mkdir dist
cp -R $repo/dist/* ./dist/



# git commit
timestamp=`date "+%Y%m%d_%H%M%S"`
git add -A
git commit -a -m $timestamp
git push origin master


# upx
#upx login oupeng wuguofeng2011 Wabc_123456
#upx sync ./dist /dist/
#upx sync ./pics /dist/%
